package com.cmcc.shared.utils

import android.content.Context
import android.os.Looper
import android.widget.Toast

fun showToast(context: Context, message:String){
    try {
        Toast.makeText(context, message, Toast.LENGTH_LONG).show()
    } catch (e: Exception) { //解决在子线程中调用Toast的异常情况处理
        Looper.prepare()
        Toast.makeText(context, message, Toast.LENGTH_LONG).show()
        Looper.loop()
    }
}